library(ggplot2)
library(gridExtra)
theme_set(theme_bw())

source('basic.R')
source('spatial.R')

n <- 21
X <- basic.funk(10)
X. <- spatial.funk(n)

p <- list()
for(i in 1:3)
	p[[i]] <- substitute({
		ggplot() +
			geom_line(aes(X[,1], X[,i+1])) +
			geom_line(aes(X.[,1], X.[,1+(i-1)*n*n + (11-1)*n+11]), linetype=2) +
			geom_line(aes(X.[,1], X.[,1+(i-1)*n*n + (3-1)*n+3]), linetype=3) +
			expand_limits(y=0) +
			ggtitle(c('Target cells','Infected cells','Free virus')[i]) +
			theme(axis.title.x=element_blank(), axis.title.y=element_blank())
		}, list(i=i))
do.call(grid.arrange, c(p, ncol=3))
